<template>
		<view class="main_contain">
			<uni-row class="demo-uni-row" v-for="(item,index) in vedioData" v-if="index%2==0">
				<uni-col :span="12">
					<view class="demo-uni-col dark">
						<video class="vedio" :src="item.vedio"
							    @error="videoErrorCallback" :danmu-list="danmuList" enable-danmu danmu-btn controls></video>
					</view>
					<view>
						<text class="vedio_detail">{{item.remark}}</text>
					</view>
				</uni-col>
				<uni-col :span="12">
					<view class="demo-uni-col light">
						<video class="vedio" :src="vedioData[index+1].vedio"
								    @error="videoErrorCallback" :danmu-list="danmuList" enable-danmu danmu-btn controls></video>
					</view>
					<view>
						<text class="vedio_detail">{{vedioData[index+1].remark}}</text>
					</view>
				</uni-col>
			</uni-row>
		</view>

</template>

<script>
	import { getVedio } from "@/api/vedio/vedio.js"
	import config from '@/config'
	
	export default {
	  data() {
	    return {
			danmuList: [],
			danmuValue: '',
			vedioData:[{}],
		  gutter: 0,
		  nvueWidth: 730,
		  // item: {
				// 	id: 1,
				// 	mainImage: '/static/images/banner2.jpg',
				// 	totalTime: '00:59:38',
				// 	title: 'uni-applws项目！',
				// 	nickName: 'lws',
				// 	isFree: 0, // 是否收费0收费，1免费
				// 	priceOriginal: 999, // 原价
				// 	priceDiscount: 599, // 优惠价
				// 	studyTotal: 399
		  // 		}
	    }
	  },
	  onLoad() {
	    this.getAppScenic()
	  },
	  methods: {
	    getAppScenic() {
			let data={pageNum:1,pageSize:10};
	      getVedio(data).then(response => {
			  this.vedioData=response.data.records;
			  // 使用for...of循环遍历对象数组
			  for (let obj of this.vedioData) {
			      obj.vedio=config.minioUrl+'/'+obj.vedio;
			  }
			console.log(this.vedioData);
				
	      })
	    },
		onChange(e)
		{
			console.log(e);
		}
	  }
	}
</script>

<style lang="scss">
	.main_contain{
		background-color: red;
	}
	.demo-uni-row{
		width: 750rpx;
		height: 400rpx;
		.uni-col{
			// width: 350rpx;

			// height: 400rpx;
			.vedio{
				width: 350rpx;
				height: 200rpx;
				margin-left: 15rpx;
				margin-top: 10rpx;
				margin-right: 5rpx;
			}
			.vedio_detail{
				font-size: 20rpx;
				margin-left: 15rpx;
			}
		}
	}
</style>